package com.example.mock;

import com.example.mtbatissource.MtbatisSourceApplication;
import com.example.mtbatissource.mock.MockController;
import com.example.mtbatissource.mock.MockServiceImpl;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = MtbatisSourceApplication.class)
public class MockControllerTest2 {

    @Mock
    private MockController mockController;

    @Before
    public void before() {
        MockitoAnnotations.initMocks(this);
    }

    @Test
    public void mockControllerTest() {
        Mockito.when(mockController.print()).thenReturn(true);
        String s = mockController.mockDemo2();
        System.out.println(s);
    }
    }
